package com.jorado.elasticsearch.model;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Objects;

public class ESCluster implements Serializable {
    private String name;
    private List<String> hosts;
    private int defaultPort = 9300;
    private Map<String, Object> settings;

    public ESCluster(List<String> hosts) {
        this.hosts = hosts;
    }

    public ESCluster(List<String> hosts, Map<String, Object> settings) {
        this.hosts = hosts;
        this.settings = settings;
    }

    public ESCluster(List<String> hosts, int defaultPort) {
        this.hosts = hosts;
        this.defaultPort = defaultPort;
    }

    public ESCluster(List<String> hosts, int defaultPort, Map<String, Object> settings) {
        this.hosts = hosts;
        this.defaultPort = defaultPort;
        this.settings = settings;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getHosts() {
        return hosts;
    }

    public void setHosts(List<String> hosts) {
        this.hosts = hosts;
    }

    public int getDefaultPort() {
        return defaultPort;
    }

    public void setDefaultPort(int defaultPort) {
        this.defaultPort = defaultPort;
    }

    public Map<String, Object> getSettings() {
        return settings;
    }

    public void setSettings(Map<String, Object> settings) {
        this.settings = settings;
    }

    @Override
    public int hashCode() {
        return Objects.hash(hosts, defaultPort, settings);
    }
}
